<template>
	<view class="homepage">

		<view class="topbox" >
	      <image src="https://changban.dianjingkeji.net/img/home.jpg" mode=""></image>
		</view>
		<view class="bannerbox">
			<view class="itembanner" @click="finddoctor">
				<view class="yuan">
					<view class="iconfont icon-yisheng">
						
					</view>
				</view>
				<view class="bannername">
					专家库
				</view>
			</view>
	<!-- 		<view class="itembanner" @click="doctorcar">
				<view class="yuan1">
					<view class="iconfont icon-vip">
						
					</view>
				</view>
				<view class="bannername">
					就医直通车
				</view>
			</view> -->
<!-- 			<view class="itembanner" @click="zhaomu">
				<view class="yuan3">
					<view class="iconfont icon-rengong"></view>
				</view>
				<view class="bannername">
					患者招募
				</view>
			</view> -->
		<!-- 	<view class="itembanner" @click="zixunfuwu">
				<view class="yuan8">
					<view class="iconfont icon-kefu"></view>
				</view>
				<view class="bannername">
					咨询服务
				</view>
			</view> -->
<!-- 			<view class="itembanner" @click="superfood">
				<view class="yuan2">
					<view class="iconfont icon-food-bomihua"></view>
				</view>
				<view class="bannername">
					超级食品
				</view>
			</view>
			<view class="itembanner">
				<view class="yuan3">
					<view class="iconfont icon-jiangbei"></view>
				</view>
				<view class="bannername">
					排行榜
				</view>
			</view> -->
			<!-- <view class="itembanner">
				<view class="yuan4">
					<view class="iconfont icon-yaowan"></view>
				</view>
				<view class="bannername">
					专科药剂
				</view>
			</view>
			<view class="itembanner">
				<view class="yuan5">
					<view class="iconfont icon-caidan"></view>
				</view>
				<view class="bannername">
					商保VIP
				</view>
			</view>
			<view class="itembanner">
				<view class="yuan6">
					<view class="iconfont icon-dna"></view>
				</view>
				<view class="bannername">
					检测套餐
				</view>
			</view> -->
			<view class="itembanner" @click="calldoctor">
				<view class="yuan10">
					<view class="iconfont icon-alarm-full"></view>
				</view>
				<view class="bannername">
					预约120
				</view>
			</view>
	<!-- 		<view class="itembanner">
				<view class="yuan7">
					<view class="iconfont icon-yisheng"></view>
				</view>
				<view class="bannername">
					安心陪护
				</view>
			</view> -->
			
	
	<!-- 		<view class="itembanner">
				<view class="yuan9">
					<view class="iconfont icon-w_heiban"></view>
				</view>
				<view class="bannername">
					学术交流
				</view>
			</view> -->

		
	
		</view>
		
		<view class="addressbox">
			<swiper class="swiper" autoplay vertical circular :interval="3000" :duration="1000">
				<swiper-item v-for="item in msglist" :key="item.noticeId" @click="gomsgdetail(item)">
					<view class="swiper-item">
					  <view class="title">
						  
					  	{{item.noticeTitle}}
					  </view>
					  <view class="addresss">
						  <rich-text :nodes="item.noticeContent"></rich-text>
					  
					  </view>
					</view>
				</swiper-item>
				
			</swiper>
		</view>
		
        <view class="bannertitle">
        	<view class="iconfont icon-tianjiarenyuan">
        		
        	</view>
			6X数字健康管理
        </view>
		<view class="boxlist">
			<view class="itembox" @click="yishengchangban">
				<view class="boxnameline">
					<view class="yuan">
						<view class="iconfont icon-yisheng">
							
						</view>
					</view>
					 <view class="boxname">
					 	专家指导
					 </view>
				</view>
				<view class="boxtitle">
					医嘱及自我管理方案
				</view>
				<view class="weekline">
					<view class="jieduan">
						6阶段
					</view>
					<view class="week">
						·13周
					</view>
				</view>
				<view class="time">
					7X24小时
				</view>
			</view>
			<view class="itembox" @click="yingyangshiliao">
				<view class="boxnameline">
					<view class="yuan">
						<view class="iconfont icon-yisheng">
							
						</view>
					</view>
					 <view class="boxname">
					 	营养食疗
					 </view>
				</view>
				<view class="boxtitle">
					医嘱及自我管理方案
				</view>
				<view class="weekline">
					<view class="jieduan">
						6阶段
					</view>
					<view class="week">
						·13周
					</view>
				</view>
				<view class="time">
					7X24小时
				</view>
			</view>	
			<view class="itembox" @click="gosport">
				<view class="boxnameline">
					<view class="yuan">
						<view class="iconfont icon-yisheng">
							
						</view>
					</view>
					 <view class="boxname">
					 	运动方案
					 </view>
				</view>
				<view class="boxtitle">
					医嘱及自我管理方案
				</view>
				<view class="weekline">
					<view class="jieduan">
						6阶段
					</view>
					<view class="week">
						·13周
					</view>
				</view>
				<view class="time">
					7X24小时
				</view>
			</view>	
			<view class="itembox" @click="gomood">
				<view class="boxnameline">
					<view class="yuan">
						<view class="iconfont icon-yisheng">
							
						</view>
					</view>
					 <view class="boxname">
					 	压力情绪
					 </view>
				</view>
				<view class="boxtitle">
					医嘱及自我管理方案
				</view>
				<view class="weekline">
					<view class="jieduan">
						6阶段
					</view>
					<view class="week">
						·13周
					</view>
				</view>
				<view class="time">
					7X24小时
				</view>
			</view>	
			<view class="itembox" @click="gosleep">
				<view class="boxnameline">
					<view class="yuan">
						<view class="iconfont icon-yisheng">
							
						</view>
					</view>
					 <view class="boxname">
					 	睡眠优化
					 </view>
				</view>
				<view class="boxtitle">
					医嘱及自我管理方案
				</view>
				<view class="weekline">
					<view class="jieduan">
						6阶段
					</view>
					<view class="week">
						·13周
					</view>
				</view>
				<view class="time">
					7X24小时
				</view>
			</view>	
			<view class="itembox" @click="gojiankang">
				<view class="boxnameline">
					<view class="yuan">
						<view class="iconfont icon-yisheng">
							
						</view>
					</view>
					 <view class="boxname">
					 	健康素养
					 </view>
				</view>
				<view class="boxtitle">
					医嘱及自我管理方案
				</view>
				<view class="weekline">
					<view class="jieduan">
						6阶段
					</view>
					<view class="week">
						·13周
					</view>
				</view>
				<view class="time">
					7X24小时
				</view>
			</view>
		</view>
 

	</view>
</template>

<script>
	import {getInfo,getNotice,changbanService,getConfig} from '../../utils/api.js'
	export default {
		data() {
			return {
				jump:'',
				user:{},
				msglist:[
					{   noticeType:2,
						noticeTitle:'肠道菌群筛查',
						noticeContent:'地点：河北医科大学第二医院 时间：9月28日'
					},
					{   noticeType:1,
						noticeTitle:'患者招募',
						noticeContent:'地点：河北医科大学第二医院 时间：9月28日'
					}
				],
				menushow:false,
				doctorlongwait:[]
			}
		},
		onShow() {
			getConfig().then(res=>{
				console.log(res)
				this.jump=res.data.msg
			})

			let p={
				phone:uni.getStorageSync('phone')	
			}
	
     //       getInfo(p).then(res=>{
			  
			  //  this.user=res.data.data.info
			  //  uni.setStorageSync('user',res.data.data.info)
		   // })
		   getNotice().then(res=>{
			   
			   this.msglist=res.data.data
		   })
		},
		methods: {
			gojiankang(){
				if(this.jump==1){
					uni.navigateTo({
						url:'/pagesB/health/health'
					})
				}else{
					uni.showToast({
						title: '敬请期待',
						icon:'none',
						duration: 2000
					});
				}
				
				
			},
			gosleep(){
				if(this.jump==1){
					uni.navigateTo({
						url:'/pagesB/sleep/sleep'
					})
				}else{
					uni.showToast({
						title: '敬请期待',
						icon:'none',
						duration: 2000
					});
				}
				
				
			},
			gomood(){
				if(this.jump==1){
					uni.navigateTo({
						url:'/pagesB/mood/mood'
					})
				}else{
					uni.showToast({
						title: '敬请期待',
						icon:'none',
						duration: 2000
					});
				}
				
			},
			yingyangshiliao(){
				if(this.jump==1){
					uni.navigateTo({
						url:'/pagesA/yinshijilu/yinshijilu'
					})
				}else{
					uni.showToast({
						title: '敬请期待',
						icon:'none',
						duration: 2000
					});
				}
				
			},
			zhaomu(){
				if(this.jump==1){
					uni.navigateTo({
						url:'/pagesB/zhaomu/zhaomu'
					})	
				}else{
					uni.showToast({
						title: '敬请期待',
						icon:'none',
						duration: 2000
					});
				}
			 
			},
			zixunfuwu(){
				if(this.jump==1){
					uni.navigateTo({
						url:'/pagesA/AItalk/AItalk'
					})
				}else{
					uni.showToast({
						title: '敬请期待',
						icon:'none',
						duration: 2000
					});
				}
				
			},
			
			yishengchangban(){
				uni.navigateTo({
					url:'/pagesA/changban/changban'
				})
			},
			gomsgdetail(e){
				if(this.jump==1){
						uni.navigateTo({
							url:'/pagesB/zhaomu/zhaomu'
						})
				}else{
					uni.showToast({
						title: '敬请期待',
						icon:'none',
						duration: 2000
					});
				}
				
			},
			
			govip(){
			if(this.jump==1){
					uni.navigateTo({
						url:'/pagesB/vipfuwu/vipfuwu'
					})
			}else{
				uni.showToast({
					title: '敬请期待',
					icon:'none',
					duration: 2000
				});
			}
				
			},
			gozhuanbing(){
		if(this.jump==1){
				uni.navigateTo({
					url:'/pagesB/zhuanbing/zhuanbing'
				})
		}else{
			uni.showToast({
				title: '敬请期待',
				icon:'none',
				duration: 2000
			});
		}
				
			},
			
			
			goteam(){
		if(this.jump==1){
			uni.navigateTo({
				url:'/pagesB/myteam/myteam'
			})
		}else{
			uni.showToast({
				title: '敬请期待',
				icon:'none',
				duration: 2000
			});
		}
				
			},
		
			gosport(){
			if(this.jump==1){
				uni.navigateTo({
					url:'/pagesA/sport/sport'
				})
			}else{
				uni.showToast({
					title: '敬请期待',
					icon:'none',
					duration: 2000
				});
			}
				
			},
	
			
		
			
			//找专家
			finddoctor(){
				uni.navigateTo({
					url:'/pagesA/find/find'
				})
			},
			
			//超级食品
			superfood(){
				if(this.jump==1){
				uni.navigateTo({
					url:'/pagesB/superfood/superfood'
				})
				}else{
					uni.showToast({
						title: '敬请期待',
						icon:'none',
						duration: 2000
					});
				}
			
			},
			
			//预约120
			calldoctor(){
				if(this.jump==1){
			uni.navigateTo({
				url:'/pagesB/calldoctor/calldoctor'
			})
				}else{
					uni.showToast({
						title: '敬请期待',
						icon:'none',
						duration: 2000
					});
				}
			
			},
			//就医直通车
			doctorcar(){
				if(this.jump==1){
				uni.navigateTo({
					url:'/pagesB/doctorcar/doctorcar'
				})
					}else{
						uni.showToast({
							title: '敬请期待',
							icon:'none',
							duration: 2000
						});
					
				}
			},
			
			//我的食品库
			myfood(){
				if(this.jump==1){
				uni.navigateTo({
					url:'/pagesA/myfoods/myfoods'
				})
					}else{
						uni.showToast({
							title: '敬请期待',
							icon:'none',
							duration: 2000
						});
					
				}
			
			},
			
		
			
			 
			
		}
	}
</script>

<style lang="less" scoped>
	.homepage{
		width: 750rpx;
		box-sizing: border-box;
		padding-bottom: 250rpx;
		background-color: whitesmoke;
		
		.topbox{
			width: 100%;
			height: 400rpx;
			box-sizing: border-box;
			image{
				width: 100%;
				height: 100%;
			}
	
		
		}
		.addressbox{
		width: 100%;
		height: 180rpx;
		margin: 20rpx 0;
		.swiper{
			width: 100%;
			height: 100%;
			.swiper-item{
				width: 100%;
				height: 100%;
				box-sizing: border-box;
				padding: 20rpx ;
				background-color: white;
				line-height: 2.2;
				.title{
					font-weight: bold;
					
				}
			}
		}
		}
		.bannerbox{
			width: 100%;
			 
			margin-top: 20rpx;
			padding-top: 20rpx;
			display: flex;
			align-items: flex-start;
			flex-wrap: wrap;
			background: white;
	
			.itembanner{
				width: 25%;
				margin-bottom: 30rpx;
				.yuan{
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
					line-height: 100rpx;
					text-align: center;
					margin: auto;
					background: linear-gradient(180deg, rgba(181,233,255,1) 0%,rgba(0,122,191,1) 100%);
					.iconfont{
						font-size: 50rpx;
						font-weight: bold;
						color: white;
					}
				}
				.yuan1{
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
					line-height: 100rpx;
					text-align: center;
					margin: auto;
					background: linear-gradient(180deg, rgba(224,207,144,1) 0%,rgba(133,119,46,1) 100%);
					.iconfont{
						color: white;
						font-size: 50rpx !important;
						
					}
				}
				.yuan2{
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
					line-height: 100rpx;
					text-align: center;
					margin: auto;
					background: linear-gradient(180deg, rgba(86,209,56,1) 0%,rgba(24,116,39,1) 100%);
					.iconfont{
						color: white;
						font-size: 50rpx !important;
						
					}
				}
				.yuan3{
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
					line-height: 100rpx;
					text-align: center;
					margin: auto;
					background: linear-gradient(180deg, rgba(255,227,194,1) 0%,rgba(255,138,0,1) 100%);
					.iconfont{
						color: white;
						font-size: 50rpx !important;
						
					}
				}
				.yuan4{
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
					line-height: 100rpx;
					text-align: center;
					margin: auto;
					background: linear-gradient(180deg, rgba(139,199,253,1) 0%,rgba(0,19,255,1) 100%);
					.iconfont{
						color: white;
						font-size: 50rpx !important;
						
					}
				}
				.yuan5{
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
					line-height: 100rpx;
					text-align: center;
					margin: auto;
					background: linear-gradient(180deg, rgba(183,181,255,1) 0%,rgba(105,35,255,1) 100%);
					.iconfont{
						color: white;
						font-size: 50rpx !important;
						
					}
				}
				.yuan6{
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
					line-height: 100rpx;
					text-align: center;
					margin: auto;
					background: linear-gradient(180deg, rgba(240,181,255,1) 0%,rgba(200,42,255,1) 100%);
					.iconfont{
						color: white;
						font-size: 50rpx !important;
						
					}
				}
				.yuan7{
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
					line-height: 100rpx;
					text-align: center;
					margin: auto;
					background: linear-gradient(180deg, rgba(181,255,206,1) 0%,rgba(0,191,53,1) 100%);
					.iconfont{
						color: white;
						font-size: 50rpx !important;
						
					}
				}
				.yuan8{
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
					line-height: 100rpx;
					text-align: center;
					margin: auto;
					background: linear-gradient(180deg, rgba(129,232,255,1) 0%,rgba(40,141,185,1) 100%);
					.iconfont{
						color: white;
						font-size: 50rpx !important;
						
					}
				}
				.yuan9{
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
					line-height: 100rpx;
					text-align: center;
					margin: auto;
					background: linear-gradient(180deg, rgba(183,181,255,1) 0%,rgba(105,35,255,1) 100%);
					.iconfont{
						color: white;
						font-size: 50rpx !important;
						
					}
				}
				.yuan10{
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
					line-height: 100rpx;
					text-align: center;
					margin: auto;
					background: linear-gradient(180deg, rgba(255,227,194,1) 0%,rgba(255,15,0,1) 100%);
					.iconfont{
						color: white;
						font-size: 50rpx !important;
						
					}
				}
				
				.bannername{
					text-align: center;
					font-size: 26rpx;
					margin-top: 10rpx;
					color: #343434 ;
					font-weight: bold;
					font-family: SourceHanSansSC-regular;
				}
				
				
			}
		}
		.bannertitle{
			display: flex;
			align-items: center;
			color: #1a4f8a;
			margin: 30rpx;
			font-size: 38rpx;
			font-weight: bold;
			
			.iconfont{
				font-size: 50rpx;
				font-weight: bold;
			}
		}
		.boxlist{
			width: 100%;
			box-sizing: border-box;
			padding: 20rpx;
			display: flex;
			flex-wrap: wrap;
			align-items: flex-start;
			.itembox{
				width: 48%;
				margin: 20rpx 1%;
				box-sizing: border-box;
				padding: 20rpx;
				background-color: white;
				border-radius: 20rpx;
				.boxnameline{
					display: flex;
					align-items: center;
					margin-bottom: 30rpx;
					.yuan{
						width: 90rpx;
						height: 90rpx;
						border-radius: 50%;
						background-color: #F4F5F7 ;
						margin-right: 20rpx;
						line-height: 90rpx;
						text-align: center;
						.iconfont{
							color: #1a4f8a;
							margin: auto;
							font-weight: bold;
							font-size: 50rpx;
						}
						
					}
					.boxname{
						font-weight: 800;
					}
				}
				.boxtitle{
					font-size: 28rpx;
					color: gray;
					width: 100%;
					box-sizing: border-box;
					height: 100rpx;
				}
				.weekline{
					display: flex;
					align-items: center;
					font-size: 28rpx;
					font-weight: bold;
					line-height: 1.8;
					.jieduan{
						color: #9E23FF;
					}
				}
				.time{
					font-weight: bold;
					line-height: 2;
					font-size: 26rpx;
					color: gray;
				}
			}
			
		}
	
		
		
		
		
		
		
		
		
		
		
		
		
		
		
	}
</style>
